<include file="Public/_meta" />
<title>消费业务</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 消费业务 <span class="c-gray en">&gt;</span> 消费列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>


<div class="page-container">
<form action="{:U('Consump/index',array('p'=>$p))}" method="post">
	<div class="text-c">
		<select name="type" class="select-box inline">
			<option value="1">贷款人姓名</option>
			<option value="2">推荐人</option>
            <option value="3">房屋地址</option>
		</select>
		<input type="text" name="content" id="content"  style="width:250px" class="input-text">
		<button type="submit" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i>搜索</button>
	</div>
	</form>
	<div class="cl pd-5 bg-1 bk-gray mt-20"> 
	    <span class="l">
    	    <?php if(strstr($user_auth['level'],"39")){ ?><a href="javascript:;" onClick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> <?php } ?>
    	    <?php if(strstr($user_auth['level'],"40")){ ?><a class="btn btn-primary radius" onClick="picture_add('建档','{:U('Consump/consumptionadd')}')" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i>建档</a><?php } ?>
	    </span> 
	    <span class="r">共有数据：<strong>{$num}</strong> 条</span> 
	</div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-hover table-sort">
			<thead>
				<tr class="text-c">
					<th width="25"><input type="checkbox" name="" value=""></th>
					<th width="80">姓名</th>
                    <th width="120">建档时间</th>
					<th width="80">贷款银行</th>
					<th width="80">贷款金额（万元）</th>					
					<th width="75">推荐人</th>
					<th width="60">品种</th>
					<th width="120">抵押日期</th>
                    <th width="120">收费日期</th>
                    <th width="120">下款日期</th>
                    <th width="120">操作</th>
				</tr>
			</thead>
			<tbody>
				<volist name="consume" id="vo" >
				<tr class="text-c">
					<td><input type="checkbox" value="{$vo.consume_id}" name="id"></td>
					<td class="text-l"><u style="cursor:pointer" class="text-primary" onClick="article_edit('查看','{:U('Consump/consumptionalert',array('consume_id'=>$vo['consume_id']))}','10001')" title="查看">{$vo.client_name}</u></td>
					<td><if condition="$vo.creat_time neq ''">{$vo.creat_time|date="Y-m-d",###}</if></td>					
					<td>{$vo.bank_id|getBankName}</td>
                    <td>{$vo.loan_amount}</td>
                    <td>{$vo.referrer_id|getUsername}</td>
                    <td><if condition="$vo.loan_type eq 1">信用贷<elseif condition="$vo.loan_type eq 2"/>消费贷<elseif condition="$vo.loan_type eq 3"/>企业贷</if></td>
					<td><if condition="$vo.mortgage_time neq ''">{$vo.mortgage_time|date="Y-m-d",###}</if></td>
                    <td><if condition="$vo.charge_time neq ''">{$vo.charge_time|date="Y-m-d",###}</if></td>
                    <td><if condition="$vo.credit_time neq ''">{$vo.credit_time|date="Y-m-d",###}</if></td>
                    <td> <a style="text-decoration:none" class="ml-5" onClick="article_edit('查看','{:U('Consump/consumptionalert',array('consume_id'=>$vo['consume_id']))}','10001')" href="javascript:;" title="查看">查看</a> </td>				
				</tr>
				</volist>
				
			</tbody>
		</table>
	</div>
	<div class="manu">{$page}</div>
</div>



<script type="text/javascript" src="__PUBLIC__/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="__PUBLIC__/static/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="__PUBLIC__/static/h-ui.admin/js/H-ui.admin.js"></script>

<script type="text/javascript">
$('.table-sort').dataTable({
	"aaSorting": [[ 1, "desc" ]],//默认第几个排序
	"bStateSave": true,//状态保存
	"aoColumnDefs": [
	  //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
	  {"orderable":false,"aTargets":[0,8]}// 不参与排序的列
	]
});

/*建档-添加*/
function picture_add(title,url){
	var index = layer.open({
		type: 2,
		title: title,
		content: url
	});
	layer.full(index);
}
/*资讯-编辑*/
function article_edit(title,url,id,w,h){
	var index = layer.open({
		type: 2,
		title: title,
		content: url
	});
	layer.full(index);
}
/*资讯-删除*/

function datadel(){
	var chk_value =[];
   $('input[name="id"]:checked').each(function(){
   chk_value.push($(this).val());
  });

  if(chk_value.length==0){
    layer.msg('您还没有选择要删除的数据');
  }
  else{
    $.ajax({
           type:"post",
           url:"{:U('Consump/delDatas')}",
           data:{id:chk_value},
           dataType:'json',
           success:function(msg){
               if(msg.ResultCode=='200'){
                 layer.msg(msg.ResultMessage,{time:1000},  function(){
                   window.location.reload();
                 });
               }
               else{layer.msg(msg.ResultMessage)}
           }
       });
  }
}
</script>
</body>
</html>